import request from '@/utils/request'

const api_name = '/serviceedu/edu-course'

export default {
  addCourseInfo(courseInfo) {
    return request({
      url: `${api_name}/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  //2.查询所有讲师
  getListTeacher() {
    return request({
      url: '/serviceedu/edu-teacher/findAll',
      method: 'get'
    })
  },
  //根据课程id查询课程信息(回显)
  getCourseInfo(id) {
    return request({
      url: '/serviceedu/edu-course/getCourseInfo/'+id,
      method: 'get'
    })
  },
//修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: '/serviceedu/edu-course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  //课程确认信息显示
  getCoursePublishInfoById(id) {
    return request({
      url: `${api_name}/getPublishCourseInfo/${id}`,
      method: 'get'
    })
  },
//课程最终发布
  publishCourse(id) {
    return request({
      url: `${api_name}/publishCourse/${id}`,
      method: 'post'
    })
  },
  //TODO 课程列表
  //课程最终发布
  getListCourse() {
    return request({
      url: `${api_name}`,
      method: 'get'
    })
  },
  //分页列表查询
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },


}
